using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace SideShow.Channel.Messages
{
    [Serializable]
    class RemoveApplicationMessage : Message
    {
        private Guid _appId;

        public RemoveApplicationMessage()
        {
        }

        public RemoveApplicationMessage(Guid appId)
            : base(ChannelMessages.RemoveApplication)
        {
            _appId = appId;
        }

        public Guid ApplicationId
        {
            get { return _appId; }
        }

        protected internal override void SerializeObject(BinaryWriter writer)
        {
            base.SerializeObject(writer);
            writer.Write(_appId.ToByteArray());
        }

        protected internal override void DeserializeObject(BinaryReader reader)
        {
            base.DeserializeObject(reader);
            _appId = new Guid(reader.ReadBytes(16));
        }
    }
}
